#ifndef __GUI_FONT_H
#define __GUI_FONT_H

#include <stdint.h>

typedef struct
{
	uint8_t width;
	uint8_t high;
	uint8_t bpc;       /* 字符占用的字节数 */
	uint8_t integer;   /* 每行占用整字节数 */
	uint8_t remainder; /* 每行占用非整位数 */
	uint8_t interval;  /* 每行占用的字节数 */
	uint8_t start;
  const uint8_t *indbuf;
	const uint8_t *c;
}GUI_FONT;

typedef struct
{
	uint8_t width;
	uint8_t high;
	uint8_t integer;   /* 字符每行占用整字节数 */
	uint8_t remainder; /* 字符每行占用非整字节数 */
	uint8_t interval;  /* 每行占用的字节数 */
	const uint8_t *buf;
}GUI_IMG;


extern const GUI_FONT font_asc16;
extern const GUI_FONT font_asc32;

extern void OLED_DisPlay_On(void);
extern void OLED_DisPlay_Off(void);
extern void Lcd_Init(void);
extern void Lcd_Refresh(void);
extern void Lcd_ClearScreen(void);
extern void Lcd_ClearFb(void);

extern void Lcd_DrawPixel(uint8_t x, uint8_t y, uint8_t color, uint8_t incolor);
extern void Lcd_DrawVLine(uint16_t x, uint16_t y, uint16_t length);
extern void Lcd_DrawHLine(uint16_t x, uint16_t y, uint16_t length);
extern void Lcd_DrawInvertHLine(uint16_t x, uint16_t y, uint16_t length);


extern void gui_ascs16(uint16_t x, uint16_t y, const char *s, uint8_t incolor);
extern void gui_ascs32(uint16_t x, uint16_t y, const char *s, uint8_t incolor);


extern void gui_img(uint16_t x, uint16_t y, const GUI_IMG *img, uint8_t incolor);

extern void gui_base_rectangle(uint16_t x0, uint16_t y0, uint16_t width, uint16_t high);
extern void gui_base_fillrect(uint16_t x0, uint16_t y0, uint16_t width, uint16_t high);
extern void gui_base_invertrect(uint16_t x0, uint16_t y0, uint16_t width, uint16_t high);
extern void gui_base_line(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
extern void gui_base_circle(uint16_t x, uint16_t y, uint16_t radius);
extern void gui_base_msgbox(uint16_t width, uint16_t high);
extern void gui_base_rim(uint16_t x, uint16_t y, uint16_t width, uint16_t high, uint16_t w, uint16_t h);

#endif /* __GUI_FONT_H */
